function  adjacent_matrix=getadjacentmatrix(channelMatrix,communicationrange,positionmatrix,node_number)
adjacent_matrix=zeros(node_number,node_number);
%judge_forConnection=zeros(1,channelnumber);
for loop1flag=1:node_number-1
    for loop2flag=(loop1flag+1):node_number
        if(sqrt((positionmatrix(1,loop1flag)-positionmatrix(1,loop2flag))^2 + (positionmatrix(2,loop1flag)-positionmatrix(2,loop2flag))^2 )<=communicationrange)
            judge_forConnection=channelMatrix(loop1flag,:).*channelMatrix(loop2flag,:);
            if (sum(judge_forConnection)>0)
                adjacent_matrix(loop1flag,loop2flag)=1;
                adjacent_matrix(loop2flag,loop1flag)=1;
            end
        end
    end
end